# coding: utf-8
import os
from ris_tag.model.base import Base

class Zhimas(Base):

    def __init__(self):
        super(Zhimas, self).__init__()
        self.collection = self.db['zhimas']

    def find_score(self, query):
        result = self.collection.aggregate([
            {'$match': query},
            {'$project':
                 {
                     '_id': 0,
                     'userId': 1,
                     'score': '$score.zmScore'
                 }
            }
        ])
        return list(result)
